home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / shared.dxr / 04475_Button Handler Defines.ls < prev    next >
Encoding:
Text File  |  1996-02-21  |  18.6 KB  |  499 lines

  1. global gOBJECTS, sCURSORSPRITE, gTimerList, theButtonClasses
  2.  
  3. on ShowButtonClasses
  4.   set theButtonClasses to [#ButtonDN: [], #ButtonAnimDN: [], #ButtonDNCOND: [], #DragDN: [], #OpenClose: [], #OpenCloseADDobj: [], #GrabDrag: [], #MultiStateCOND: [], #MultiState: []]
  5. end
  6.  
  7. on cursorandupdate
  8.   CallAnimEngine()
  9.   CheckMIDI()
  10.   updateStage()
  11. end
  12.  
  13. on ButtonDNAction ObjRef
  14.   set obj to getaProp(gOBJECTS, ObjRef)
  15.   if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  16.     stopSound(getaProp(getaProp(obj, #sound), #down))
  17.     playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
  18.   end if
  19.   set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
  20.   updateStage()
  21.   repeat while the stillDown
  22.     if inside(point(the mouseH, the mouseV), getAt(getaProp(obj, #HotRect), 1)) then
  23.       set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
  24.     else
  25.       set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
  26.     end if
  27.     cursorandupdate()
  28.   end repeat
  29.   set myPoint to point(the mouseH, the mouseV)
  30.   if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  31.     stopSound(getaProp(getaProp(obj, #sound), #UP))
  32.     playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
  33.   end if
  34.   set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
  35.   updateStage()
  36.   if inside(myPoint, getAt(getaProp(obj, #HotRect), 1)) then
  37.     do(getaProp(getaProp(obj, #action), #UP))
  38.   end if
  39. end
  40.  
  41. on ButtonDN ObjRef
  42.   set obj to getaProp(gOBJECTS, ObjRef)
  43.   if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  44.     stopSound(getaProp(getaProp(obj, #sound), #down))
  45.     playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
  46.   end if
  47.   set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
  48.   updateStage()
  49.   repeat while the stillDown
  50.     if inside(point(the mouseH, the mouseV), getAt(getaProp(obj, #HotRect), 1)) then
  51.       set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
  52.     else
  53.       set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
  54.     end if
  55.     cursorandupdate()
  56.   end repeat
  57.   set myPoint to point(the mouseH, the mouseV)
  58.   if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  59.     stopSound(getaProp(getaProp(obj, #sound), #UP))
  60.     playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
  61.   end if
  62.   set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
  63.   updateStage()
  64.   if inside(myPoint, getAt(getaProp(obj, #HotRect), 1)) then
  65.     do(getaProp(getaProp(obj, #action), #UP))
  66.   end if
  67. end
  68.  
  69. on ButtonAnimDN ObjRef
  70.   set obj to getaProp(gOBJECTS, ObjRef)
  71.   set dncount to count(getaProp(getaProp(obj, #cast), #down))
  72.   set upcount to count(getaProp(getaProp(obj, #cast), #UP))
  73.   set theUP to getAt(getaProp(getaProp(obj, #cast), #UP), 1)
  74.   set theDown to getAt(getaProp(getaProp(obj, #cast), #down), 1)
  75.   if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  76.     stopSound(getaProp(getaProp(obj, #sound), #down))
  77.     playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast, #NOW)
  78.   end if
  79.   set aCount to 1
  80.   set the castNum of sprite getaProp(obj, #spriteNum) to getAt(getaProp(getaProp(obj, #cast), #down), aCount)
  81.   repeat while the stillDown
  82.     set aCount to aCount + 1
  83.     if aCount > dncount then
  84.       set aCount to 1
  85.     end if
  86.     if inside(point(the mouseH, the mouseV), getAt(getaProp(obj, #HotRect), 1)) then
  87.       set the castNum of sprite getaProp(obj, #spriteNum) to getAt(getaProp(getaProp(obj, #cast), #down), aCount)
  88.       if not voidp(getaProp(getaProp(obj, #action), #WhileDown)) then
  89.         do(getaProp(getaProp(obj, #action), #WhileDown))
  90.       end if
  91.     else
  92.       set the castNum of sprite getaProp(obj, #spriteNum) to theUP
  93.       set aCount to 1
  94.     end if
  95.     cursorandupdate()
  96.   end repeat
  97.   if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  98.     stopSound(getaProp(getaProp(obj, #sound), #UP))
  99.     playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
  100.   end if
  101.   set the castNum of sprite getaProp(obj, #spriteNum) to theUP
  102.   cursorandupdate()
  103.   if not voidp(getaProp(getaProp(obj, #action), #UP)) then
  104.     do(getaProp(getaProp(obj, #action), #UP))
  105.   end if
  106. end
  107.  
  108. on ButtonDNCOND ObjRef
  109.   set obj to getaProp(gOBJECTS, ObjRef)
  110.   if getaProp(getaProp(gOBJECTS, getaProp(obj, #Parent)), #State) = getaProp(obj, #ParentState) then
  111.     if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  112.       stopSound(getaProp(getaProp(obj, #sound), #down))
  113.       playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
  114.     end if
  115.     set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
  116.     updateStage()
  117.     repeat while the stillDown
  118.       if inside(point(the mouseH, the mouseV), getAt(getaProp(obj, #HotRect), 1)) then
  119.         set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
  120.       else
  121.         set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
  122.       end if
  123.       cursorandupdate()
  124.     end repeat
  125.     set myPoint to point(the mouseH, the mouseV)
  126.     if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  127.       stopSound(getaProp(getaProp(obj, #sound), #UP))
  128.       playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
  129.     end if
  130.     set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
  131.     updateStage()
  132.     if inside(myPoint, getAt(getaProp(obj, #HotRect), 1)) then
  133.       do(getaProp(getaProp(obj, #action), #UP))
  134.     end if
  135.   end if
  136. end
  137.  
  138. on DragDN ObjRef
  139.   set obj to getaProp(gOBJECTS, ObjRef)
  140.   if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  141.     stopSound(getaProp(getaProp(obj, #sound), #down))
  142.     playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
  143.   end if
  144.   repeat while the stillDown
  145.     set H to the mouseH
  146.     set v to the mouseV
  147.     set the locV of sprite getaProp(obj, #spriteNum) to v
  148.     set the locH of sprite getaProp(obj, #spriteNum) to H
  149.     cursorandupdate()
  150.   end repeat
  151.   if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  152.     stopSound(getaProp(getaProp(obj, #sound), #UP))
  153.     playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
  154.   end if
  155.   do(getaProp(getaProp(obj, #action), #UP))
  156.   set distance to getaProp(obj, #loc) - the loc of sprite getaProp(obj, #spriteNum)
  157.   set HV to PointVals(distance)
  158.   set H to getAt(HV, 1)
  159.   set v to getAt(HV, 2)
  160.   repeat while the loc of sprite getaProp(obj, #spriteNum) <> getaProp(obj, #loc)
  161.     if v > 5 then
  162.       set v to v - 5
  163.       set Vadd to 5
  164.     else
  165.       if v < -5 then
  166.         set v to v + 5
  167.         set Vadd to -5
  168.       else
  169.         set Vadd to 0
  170.       end if
  171.     end if
  172.     if H > 5 then
  173.       set H to H - 5
  174.       set Hadd to 5
  175.     else
  176.       if H < -5 then
  177.         set H to H + 5
  178.         set Hadd to -5
  179.       else
  180.         set Hadd to 0
  181.       end if
  182.     end if
  183.     if (Hadd = 0) and (Vadd = 0) then
  184.       set the loc of sprite getaProp(obj, #spriteNum) to getaProp(obj, #loc)
  185.     end if
  186.     set the locV of sprite getaProp(obj, #spriteNum) to the locV of sprite getaProp(obj, #spriteNum) + Vadd
  187.     set the locH of sprite getaProp(obj, #spriteNum) to the locH of sprite getaProp(obj, #spriteNum) + Hadd
  188.     cursorandupdate()
  189.   end repeat
  190. end
  191.  
  192. on CPPopUp ObjRef
  193.   set obj to getaProp(gOBJECTS, ObjRef)
  194.   do(getaProp(getaProp(obj, #action), #UP))
  195. end
  196.  
  197. on DoAction ObjRef
  198.   set obj to getaProp(gOBJECTS, ObjRef)
  199.   do(getaProp(getaProp(obj, #action), #UP))
  200. end
  201.  
  202. on OpenClose ObjRef
  203.   set obj to getaProp(gOBJECTS, ObjRef)
  204.   if getaProp(obj, #State) = #open then
  205.     makeDynamic(ObjRef, #State, #close)
  206.   else
  207.     if getaProp(obj, #State) = #close then
  208.       makeDynamic(ObjRef, #State, #open)
  209.     end if
  210.   end if
  211.   if not voidp(getaProp(getaProp(obj, #sound), getaProp(obj, #State))) then
  212.     playSound(getaProp(getaProp(obj, #sound), getaProp(obj, #State)), #keyframeCast)
  213.   end if
  214.   repeat with aCast in getaProp(getaProp(obj, #cast), getaProp(obj, #State))
  215.     set the castNum of sprite getaProp(obj, #spriteNum) to aCast
  216.     cursorandupdate()
  217.   end repeat
  218.   do(getaProp(getaProp(obj, #action), #UP))
  219. end
  220.  
  221. on OpenCloseADDobj ObjRef
  222.   set obj to getaProp(gOBJECTS, ObjRef)
  223.   updateStage()
  224.   if not voidp(getaProp(getaProp(obj, #SpecialChild), getaProp(obj, #State))) then
  225.     Delobjects(getaProp(getaProp(obj, #SpecialChild), getaProp(obj, #State)))
  226.   end if
  227.   if getaProp(obj, #State) = #open then
  228.     makeDynamic(ObjRef, #State, #close)
  229.   else
  230.     if getaProp(obj, #State) = #close then
  231.       makeDynamic(ObjRef, #State, #open)
  232.     end if
  233.   end if
  234.   if not voidp(getaProp(getaProp(obj, #sound), getaProp(obj, #State))) then
  235.     playSound(getaProp(getaProp(obj, #sound), getaProp(obj, #State)), #keyframeCast)
  236.   end if
  237.   repeat with aCast in getaProp(getaProp(obj, #cast), getaProp(obj, #State))
  238.     set the castNum of sprite getaProp(obj, #spriteNum) to aCast
  239.     updateStage()
  240.   end repeat
  241.   do(getaProp(getaProp(obj, #action), #UP))
  242.   if not voidp(getaProp(getaProp(obj, #SpecialChild), getaProp(obj, #State))) then
  243.     ADDObjects(getaProp(getaProp(obj, #SpecialChild), getaProp(obj, #State)))
  244.   end if
  245. end
  246.  
  247. on getConstrainRect ObjRef
  248.   set obj to getaProp(gOBJECTS, ObjRef)
  249.   set halfWidth to the width of cast the castNum of sprite getaProp(obj, #spriteNum) / 2
  250.   set halfHeight to the height of cast the castNum of sprite getaProp(obj, #spriteNum) / 2
  251.   set constrainRect to rect(the left of sprite 1 + halfWidth, the top of sprite 1 + halfHeight, the right of sprite 1 - halfWidth, the bottom of sprite 1 - halfHeight)
  252.   return constrainRect
  253. end
  254.  
  255. on constrainSprite H, v, constrainRect
  256.   if not inside(point(H, v), constrainRect) then
  257.     if H < getAt(constrainRect, 1) then
  258.       set H to getAt(constrainRect, 1)
  259.     end if
  260.     if H > getAt(constrainRect, 3) then
  261.       set H to getAt(constrainRect, 3)
  262.     end if
  263.     if v < getAt(constrainRect, 2) then
  264.       set v to getAt(constrainRect, 2)
  265.     end if
  266.     if v > getAt(constrainRect, 4) then
  267.       set v to getAt(constrainRect, 4)
  268.     end if
  269.   end if
  270.   return point(H, v)
  271. end
  272.  
  273. on GrabDrag ObjRef
  274.   set H to the mouseH
  275.   set v to the mouseV
  276.   set obj to getaProp(gOBJECTS, ObjRef)
  277.   set OffsetH to H - the locH of sprite getaProp(obj, #spriteNum)
  278.   set OffsetV to v - the locV of sprite getaProp(obj, #spriteNum)
  279.   cursor(getaProp(gCursorList, #Grab))
  280.   if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  281.     stopSound(getaProp(getaProp(obj, #sound), #down))
  282.     playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
  283.   end if
  284.   set contrainRect to getConstrainRect(ObjRef)
  285.   repeat while the stillDown
  286.     set H to the mouseH
  287.     set v to the mouseV
  288.     set hLoc to H - OffsetH
  289.     set vLoc to v - OffsetV
  290.     constrainSprite(hLoc, vLoc, contrainRect)
  291.     set the loc of sprite getaProp(obj, #spriteNum) to constrainSprite(hLoc, vLoc, contrainRect)
  292.     cursorandupdate()
  293.   end repeat
  294.   if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  295.     stopSound(getaProp(getaProp(obj, #sound), #UP))
  296.     playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
  297.   end if
  298.   cursor(getaProp(gCursorList, #Hand))
  299.   updateStage()
  300.   SetobjLOCRECT(ObjRef)
  301.   if not voidp(getaProp(getaProp(obj, #action), #UP)) then
  302.     do(getaProp(getaProp(obj, #action), #UP))
  303.   end if
  304.   cursorandupdate()
  305. end
  306.  
  307. on GrabDragCable ObjRef
  308.   set H to the mouseH
  309.   set v to the mouseV
  310.   set obj to getaProp(gOBJECTS, ObjRef)
  311.   set OffsetH to H - the locH of sprite getaProp(obj, #spriteNum)
  312.   set OffsetV to v - the locV of sprite getaProp(obj, #spriteNum)
  313.   set CABLEref to getaProp(obj, #Cable)
  314.   set Anchor to getaProp(getaProp(gOBJECTS, CABLEref), #Anchor)
  315.   if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  316.     stopSound(getaProp(getaProp(obj, #sound), #down))
  317.     playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
  318.   end if
  319.   cursor(getaProp(gCursorList, #Grab))
  320.   repeat while the stillDown
  321.     set the locV of sprite getaProp(obj, #spriteNum) to v - OffsetV
  322.     set the locH of sprite getaProp(obj, #spriteNum) to H - OffsetH
  323.     set arect to rect(the locH of sprite getaProp(obj, #spriteNum), the locV of sprite getaProp(obj, #spriteNum), the locH of Anchor, the locV of Anchor)
  324.     CableUpdate(CABLEref, arect)
  325.     cursorandupdate()
  326.     set H to the mouseH
  327.     set v to the mouseV
  328.   end repeat
  329.   makeDynamic(CABLEref, #DisplayState, getaProp(getaProp(gOBJECTS, CABLEref), #DisplayState))
  330.   cursor(getaProp(gCursorList, #Hand))
  331.   if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  332.     stopSound(getaProp(getaProp(obj, #sound), #UP))
  333.     playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast, #NOW)
  334.   end if
  335.   if not voidp(getaProp(getaProp(obj, #action), #UP)) then
  336.     do(getaProp(getaProp(obj, #action), #UP))
  337.   end if
  338. end
  339.  
  340. on CableUpdate CABLEref, arect
  341.   set Cable to getaProp(gOBJECTS, CABLEref)
  342.   set t to the top of arect
  343.   set B to the bottom of arect
  344.   set l to the left of arect
  345.   set R to the right of arect
  346.   if R = l then
  347.     set R to R + 3
  348.   end if
  349.   if t = B then
  350.     set B to B + 3
  351.   end if
  352.   if t > B then
  353.     if l > R then
  354.       setaProp(Cable, #DisplayState, #left)
  355.     else
  356.       setaProp(Cable, #DisplayState, #right)
  357.     end if
  358.   else
  359.     if l > R then
  360.       setaProp(Cable, #DisplayState, #right)
  361.     else
  362.       setaProp(Cable, #DisplayState, #left)
  363.     end if
  364.   end if
  365.   set the castNum of sprite getaProp(Cable, #spriteNum) to getaProp(getaProp(Cable, #cast), getaProp(Cable, #DisplayState))
  366.   set arect to rect(l, t, R, B)
  367.   set the rect of sprite getaProp(Cable, #spriteNum) to arect
  368. end
  369.  
  370. on SetobjLOCRECT ObjRef
  371.   set obj to getaProp(gOBJECTS, ObjRef)
  372.   set hotrectnum to integer(getaProp(obj, #spriteNum) & "01")
  373.   makeDynamic(ObjRef, #loc, the loc of sprite getaProp(obj, #spriteNum))
  374.   set arect to list(the rect of sprite getaProp(obj, #spriteNum))
  375.   makeDynamic(ObjRef, #HotRect, arect)
  376.   setaProp(getaProp(gHotRects, hotrectnum), #rect, getAt(getaProp(obj, #HotRect), 1))
  377. end
  378.  
  379. on DynamicLOCRECT ObjRef
  380.   set obj to getaProp(gOBJECTS, ObjRef)
  381.   if not voidp(getaProp(obj, #HotRect)) then
  382.     if voidp(getaProp(obj, #Orginalrect)) then
  383.       setaProp(obj, #OrginalHotrect, value(string(getaProp(obj, #HotRect))))
  384.     end if
  385.     setAt(getaProp(obj, #HotRect), 1, the rect of sprite getaProp(obj, #spriteNum))
  386.     set hotrectnum to integer(getaProp(obj, #spriteNum) & "01")
  387.     setaProp(getaProp(gHotRects, hotrectnum), #rect, getAt(getaProp(obj, #HotRect), 1))
  388.   else
  389.     if not voidp(getaProp(obj, #SpriteProp)) then
  390.       if not voidp(getaProp(getaProp(obj, #SpriteProp), #rect)) then
  391.         if voidp(getaProp(obj, #Orginalrect)) then
  392.           setaProp(obj, #Orginalrect, value(string(getaProp(getaProp(obj, #SpriteProp), #rect))))
  393.         end if
  394.         setaProp(getaProp(obj, #SpriteProp), #rect, the rect of sprite getaProp(obj, #spriteNum))
  395.       end if
  396.     end if
  397.   end if
  398.   if not voidp(getaProp(obj, #loc)) then
  399.     if voidp(getaProp(obj, #OrginalLOC)) then
  400.       setaProp(obj, #OrginalLOC, value(string(getaProp(obj, #loc))))
  401.       makeDynamic(ObjRef, #OrginalLOC, value(string(getaProp(obj, #loc))))
  402.     end if
  403.     setaProp(obj, #loc, the loc of sprite getaProp(obj, #spriteNum))
  404.   end if
  405. end
  406.  
  407. on ConstDrag ObjRef
  408.   set obj to getaProp(gOBJECTS, ObjRef)
  409.   set DirConst to getaProp(obj, #DirConst)
  410.   set ConstMax to getaProp(obj, #ConstMax)
  411.   set ConstMin to getaProp(obj, #ConstMin)
  412.   if not voidp(getaProp(getaProp(obj, #sound), #down)) then
  413.     stopSound(getaProp(getaProp(obj, #sound), #down))
  414.     playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
  415.   end if
  416.   cursor(getaProp(gCursorList, #Grab))
  417.   updateStage()
  418.   if getaProp(obj, #DirConst) = #v then
  419.     set OffsetV to the mouseV - the locV of sprite getaProp(obj, #spriteNum)
  420.     repeat while the stillDown
  421.       set v to the mouseV - OffsetV
  422.       if (v < ConstMax) and (v > ConstMin) then
  423.         if not voidp(getaProp(obj, #Children)) then
  424.           set theChildren to getaProp(obj, #Children)
  425.           repeat with Child in theChildren
  426.             set distance to the locV of sprite getaProp(obj, #spriteNum) - v
  427.             PullChild(Child, point(0, distance))
  428.           end repeat
  429.         end if
  430.         set the locV of sprite getaProp(obj, #spriteNum) to v
  431.         if not voidp(getaProp(getaProp(obj, #action), #WhileDown)) then
  432.           do(string(getaProp(getaProp(obj, #action), #WhileDown) & "(#" & ObjRef & ")"))
  433.         end if
  434.         cursorandupdate()
  435.       end if
  436.     end repeat
  437.   else
  438.     if getaProp(obj, #DirConst) = #H then
  439.       set OffsetH to the mouseH - the locH of sprite getaProp(obj, #spriteNum)
  440.       repeat while the stillDown
  441.         set H to the mouseH - OffsetH
  442.         if (H < ConstMax) and (H > ConstMin) then
  443.           if not voidp(getaProp(obj, #Children)) then
  444.             set theChildren to getaProp(obj, #Children)
  445.             repeat with Child in theChildren
  446.               set distance to the locH of sprite getaProp(obj, #spriteNum) - H
  447.               PullChild(Child, point(distance, 0))
  448.             end repeat
  449.           end if
  450.           set the locH of sprite getaProp(obj, #spriteNum) to H
  451.           if not voidp(getaProp(getaProp(obj, #action), #WhileDown)) then
  452.             do(string(getaProp(getaProp(obj, #action), #WhileDown) & "(#" & ObjRef & ")"))
  453.           end if
  454.           cursorandupdate()
  455.         end if
  456.       end repeat
  457.     end if
  458.   end if
  459.   if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
  460.     stopSound(getaProp(getaProp(obj, #sound), #UP))
  461.     playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
  462.   end if
  463.   cursor(getaProp(gCursorList, #Hand))
  464.   updateStage()
  465.   set hotrectnum to integer(getaProp(obj, #spriteNum) & "01")
  466.   makeDynamic(ObjRef, #loc, the loc of sprite getaProp(obj, #spriteNum))
  467.   setAt(getaProp(obj, #HotRect), 1, the rect of sprite getaProp(obj, #spriteNum))
  468.   setaProp(getaProp(gHotRects, hotrectnum), #rect, getAt(getaProp(obj, #HotRect), 1))
  469.   repeat with Child in theChildren
  470.     PullChildUPdate(Child)
  471.   end repeat
  472.   cursorandupdate()
  473. end
  474.  
  475. on PullChild ObjRef, distance
  476.   set obj to getaProp(gOBJECTS, ObjRef)
  477.   set the loc of sprite getaProp(obj, #spriteNum) to the loc of sprite getaProp(obj, #spriteNum) - distance
  478.   if not voidp(getaProp(obj, #Children)) then
  479.     set theChildren to getaProp(obj, #Children)
  480.     repeat with Child in theChildren
  481.       PullChild(Child, distance)
  482.     end repeat
  483.   end if
  484. end
  485.  
  486. on PullChildUPdate ObjRef
  487.   set obj to getaProp(gOBJECTS, ObjRef)
  488.   set hotrectnum to integer(getaProp(obj, #spriteNum) & "01")
  489.   setaProp(obj, #loc, the loc of sprite getaProp(obj, #spriteNum))
  490.   setAt(getaProp(obj, #HotRect), 1, the rect of sprite getaProp(obj, #spriteNum))
  491.   setaProp(getaProp(gHotRects, hotrectnum), #rect, getAt(getaProp(obj, #HotRect), 1))
  492.   if not voidp(getaProp(obj, #Children)) then
  493.     set theChildren to getaProp(obj, #Children)
  494.     repeat with Child in theChildren
  495.       PullChildUPdate(Child)
  496.     end repeat
  497.   end if
  498. end
  499.